package com.feinno.urcs.group.pd.task;

import com.feinno.urcs.group.api.GroupService;
import com.feinno.urcs.group.siptask.task.GroupMessageArgs;
import com.feinno.urcs.sip.SipConnector;
import org.helium.framework.task.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by wuhao on 5/11/15.
 */
public class PdGroupMessageTask implements Task<GroupMessageArgs> {
    private static final Logger LOGGER = LoggerFactory.getLogger(PdGroupMessageTask.class);
    private SipConnector connector;
    private GroupService groupService;

    public void setConnector(SipConnector connector) {
        this.connector = connector;
    }

    public void setGroupService(GroupService groupService) {
        this.groupService = groupService;
    }

    /**
     *  发送群组中通往单个成员的消息
     *  @author wuhao
     */
    @Override
    public void processTask(GroupMessageArgs groupMessageArgs) {
        LOGGER.info("PdGroupMessageTask Process Start");
//        if (groupMessageArgs != null){
//            if(groupMessageArgs.getContent().length < PdGroupMessageHelper.getPageModeMaxSize()){
//                LOGGER.info("send PageMode message length{}" + groupMessageArgs.getContent().length);
//                //PdGroupMessageHelper.sendPageMode(groupMessageArgs);
//            }else if(groupMessageArgs.getContent().length >= PdGroupMessageHelper.getPageModeMaxSize()){
//                LOGGER.info("send LargeMode message length{}" + groupMessageArgs.getContent().length);
//                //PdGroupMessageHelper.sendLargeMode(groupMessageArgs);
//            }else{
//                LOGGER.info("nothing to send");
//            }
//        }
        LOGGER.info("PdGroupMessageTask Process End");
    }

}
